package com.example.demo.util;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;

/**
 * @author BleethNie
 * @version 1.0
 * @date 2020/10/26 10:17
 **/
public class DataSource {
    public static void main(String[] args) throws TimeoutException {
        Map<String,Object> paramData=new HashMap<>();
        paramData.put("regionCode","420100");
        paramData.put("type","实施清单");
       /* paramData.put("App Key","770304097134837760");
        paramData.put("App Secret","29691e105c2045e7a8b41414e27e9ca6");*/
       Map<String,String> header =new HashMap<>();
       header.put("Aep-AppKey","770311024879337472");
       header.put("Aep-AppSecret","caa46a484b1b4758a7260f3689b41206");
        String httpRequest = HttpRequest.post("http://59.208.149.106:81/api/standard/transact/project/getTransactNumNew")
                    .addHeaders(header)
                    .form(paramData)
                    .execute()
                    .body();
        System.out.println(httpRequest);
            JSONObject object = JSONUtil.parseObj(httpRequest);
            JSONObject data = object.getJSONObject("data");
        System.err.println(data);

            /*JSONArray list = data.getJSONArray("list");

            System.err.println(StrUtil.format("----------第{}页返回结果----------",i));
            System.err.println(list);


            FileUtil.writeUtf8String(list.toStringPretty(),"E:\\beijingcsv11\\"+i+".json");

            ThreadUtil.sleep(1000);
*/



        }
    }

